<h1>评论列表</h1>

<table width="100%"   cellspacing="4" cellpadding="4" border="0" align="center" bgcolor="#f0f0f0">
<tbody>


<tr BGCOLOR=#FFCC33>
    <td>Body</td>
    <td>User</td>
    <td>Topic</td>
    <td>Time</td>
    <td>Action</td> 
</tr>
  
<% for comment in @comments %>
  <tr>

    <td><%= link_to  sanitize(truncate(strip_tags(comment.body), 14)),{:controller => "/admin/comment", :action => "view",:id=>comment.id},{:title=>comment.body}%></td>
    <td><%=link_to comment.name, comment.website%></td>
    <td><%=comment.topic_id%></td>
    <td><%=comment.created_at.to_s(:short)%></td>

    
    <td><%= link_to 'Show', :action => 'show', :id => comment %>
    ,<%= link_to 'Edit', :action => 'edit', :id => comment %>
    ,<%= link_to 'Destroy', { :action => 'destroy', :id => comment }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @comment_pages.current.previous } if @comment_pages.current.previous %>
<%= link_to 'Next page', { :page => @comment_pages.current.next } if @comment_pages.current.next %> 

<br />

<%= link_to 'New comment', :action => 'new' %>
